home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 271_02 / vidpixel.doc < prev    next >
Text File  |  1987-08-18  |  2KB  |  51 lines

  1.  
  2.  
  3.         NAME
  4.                 vid_wrpix -- write a pixel to the screen
  5.                 vid_rdpix -- read a pixel from the screen
  6.  
  7.         SYNOPSIS
  8.                 (void) vid_wrpix(x, y, clr);
  9.                 clr = vid_palette(x, y);
  10.                 int x, y;      x and y screen coordinates
  11.                 int clr;       one of the 4 color values for current palette
  12.  
  13.  
  14.         DESCRIPTION
  15.         These two functions manipulate the CGA card, or EGA card in
  16.         CGA graphics mode.
  17.         vid_wrpix() will set the pixel at location x,y to the color
  18.         clr, which is 0, 1, 2, or 3.  The real color will be as
  19.         set via vid_palette().  For black and white 640 graphics,
  20.         use 0 or 1 only.
  21.         vid_rdpix() will return the color value (0-3) at the specified
  22.         x,y location.
  23.         If using black&white 640 x 200 graphics mode on a CGA, then
  24.         the color value for vid_wrpix should be 0 or 1.  0 will set
  25.         the pixel to black (which is the background color), and 1 will
  26.         set the pixel to the color which has been previously selected
  27.         by vid_border()  (the default is, of course, white).  In BW640
  28.         mode, therefore, the pixels can only be turned on or off.  There
  29.         is no possibility of multi-color displays.
  30.         These functions do not support the extra modes of the EGA or PGA
  31.         adapters.
  32.  
  33.  
  34.         EXAMPLE
  35.  
  36.            vmode(CG320);   /* set 320 color graphics mode */
  37.            vid_border(BLUE);  /* set border and graphics background color */
  38.            vid_palette(1);    /* select palette 1 */
  39.            vid_wrpix(10, 10, 2)  /* write a pixel at x10, y10, color 2,
  40.                                     which is magenta in palette 1 */
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.         This function is found in SMTCx.LIB for the Turbo-C Compiler.
  51.